package cate.game.play.config.skill;

import cate.common.table.fight.skill.row.SkillEnhanceRow;
import cate.common.util.XT;
import easy.java.dev.note.NoteField;

import java.util.List;

public class SkillEnhance {

	@NoteField("物理技能特性")
	public Boolean featurePhy;

	@NoteField("法术技能特性")
	public Boolean featureMagic;

	@NoteField("附加cd")
	public int exCD;

	@NoteField("重选目标")
	public Byte retarget;

	@NoteField("附加目标数量")
	public int exTargetNum;

	@NoteField("特殊目标规则")
	public Byte cSpecial;

	@NoteField("附加的作用职业")
	public List<Byte> cJobs;

	@NoteField("附加的作用阵营")
	public List<Byte> cCamps;

	@NoteField("排序属性")
	public Integer cAttr;

	@NoteField("附加的作用技能标签")
	public List<String> cSkillTags;

	@NoteField("附加的作用buff标签")
	public List<String> cBuffTags;

	@NoteField("附加的主动效果类型")
	public List<String> exEffects;

	@NoteField("附加的buff添加规则")
	public List<String> exBuffAddRules;

	@NoteField("附加的施法者临时属性")
	public List<String> exCasterAttrs;

	@NoteField("附加的主动脚本参数")
	public List<String> exActiveScriptArgs;

	@NoteField("附加的被动脚本参数")
	public List<String> exPassiveScriptArgs;

	@NoteField("附加的子技能id")
	public List<Integer> exSubSkills;

	@NoteField("附加的被动buff")
	public List<String> exPassiveBuffs;


	public void settle(SkillEnhanceRow row) {
		featurePhy = row.featurePhy == null ? featurePhy : row.featurePhy;
		featureMagic = row.featureMagic == null ? featureMagic : row.featureMagic;
		exCD = row.cd == null ? exCD : exCD + row.cd;
		retarget = row.retarget == null ? retarget : row.retarget;
		exTargetNum = row.tarNum == null ? exTargetNum : exTargetNum + row.tarNum;
		cSpecial = row.cSpecial == null ? cSpecial : row.cSpecial;
		cJobs = XT.merge(cJobs, row.cJobs);
		cCamps = XT.merge(cCamps, row.cCamps);
		cAttr = row.cAttr == null ? cAttr : row.cAttr;
		cSkillTags = XT.merge(cSkillTags, row.cSkillTags);
		cBuffTags = XT.merge(cBuffTags, row.cBuffTags);
		exEffects = XT.merge(exEffects, row.exEffects);
		exBuffAddRules = XT.merge(exBuffAddRules, row.exBuffAddRules);
		exCasterAttrs = XT.merge(exCasterAttrs, row.exCasterAttrs);
		exActiveScriptArgs = XT.merge(exActiveScriptArgs, row.exActiveScriptArgs);
		exPassiveScriptArgs = XT.merge(exPassiveScriptArgs, row.exPassiveScriptArgs);
		exSubSkills = XT.merge(exSubSkills, row.exSubSkills);
		exPassiveBuffs = XT.merge(exPassiveBuffs, row.exPassiveBuffs);
	}
}
